﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LowLevelGraphics.Filter
{
    /// <summary>
    /// B = impyramid(A, direction) computes a Gaussian pyramid reduction or expansion of A by one level
    /// direction can be 'reduce' or 'expand'.
    /// 
    /// If A is m-by-n and direction is 'reduce', then the size of B is ceil(M/2)-by-ceil(N/2).
    /// If direction is 'expand', then the size of B is (2*M-1)-by-(2*N-1).
    /// 
    /// Reduction and expansion take place only in the first two dimensions. 
    /// For example, if A is 100-by-100-by-3 and direction is 'reduce', then B is 50-by-50-by-3.
    /// 
    /// Note that impyramid uses the kernel specified on page 533 of the Burt and Adelson paper cited below:
    /// , where  .
    /// 
    /// The parameter a is chosen to be 0.375 so that the equivalent weighting function is close to a Gaussian shape
    /// and the weights can be readily applied using fixed-point arithmetic.    
    /// </summary>
    public class impyramid : BaseImageFilter
    {
        /// <summary>
        /// 
        /// </summary>
        public impyramid()
        { 
        }

        /// <summary>
        /// used for cloning
        /// </summary>
        /// <param name="_impyramid"></param>
        internal impyramid(impyramid _impyramid)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="_bitmap"></param>
        /// <returns></returns>
        public override UnsafeBitmap Execute(UnsafeBitmap _bitmap)
        {
            return base.Execute(_bitmap);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            return new impyramid(this);
        }
    }
}
